import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LoginView from '../views/Login.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    children:[
      {
        // 用户管理
        path: '/user',
        name: 'user',
        component:()=>import('../components/HyFolder/UserControl/UserControl.vue'),
        children:[
         { path: '/UserControlTable',
          name: 'UserControlTable',
          component:()=>import('../components/HyFolder/UserControl/UserControlTable.vue'),
          children:[
            { path: '/UserControlAmend ',
            name: 'UserControlAmend ',
            component:()=>import('../components/HyFolder/UserControl/UserControlAmend .vue')
            },
          ]
        },
        { path: '/UserControlAdd',
        name: 'UserControlAdd',
        component:()=>import('../components/HyFolder/UserControl/UserControlAdd.vue')
        },
        ]
      },
      // 用户管理/用户授权
      { path: '/UserControlImpower',
      name: 'UserControlImpower',
      component:()=>import('../components/HyFolder/UserControl/UserControlImpower.vue')
      },
      // 系统配置
      { path: '/SystemConfig',
      name: 'SystemConfig',
      component:()=>import('../components/HyFolder/SystemConfig/SystemConfig.vue')
      },
      // 系统日志
      { path: '/SystemLog',
      name: 'SystemLog',
      component:()=>import('../components/HyFolder/SystemLog/SystemLog.vue'),
      children:[
        { path: '/SystemLogTable',
        name: 'SystemLogTable',
        component:()=>import('../components/HyFolder/SystemLog/SystemLogTable.vue')
        },
      ]
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: LoginView
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
